import Vue from 'vue'
import VueRouter from 'vue-router'
import PageRouter from './index.js'
// import ViewsRouter from './views/'
import AvueRouter from './avue-router.js'
import Store from '../store/index.js'
Vue.use(VueRouter)
//创建路由
export const createRouter = () => new VueRouter({
    routes: [...PageRouter]
})
const Router = createRouter()
AvueRouter.install(Router, Store)
// 重置路由
export function resetRouter() {
    const newRouter = createRouter()
    Router.matcher = newRouter.matcher
    AvueRouter.install(Router, Store)
}
export default Router
